package com.linwen.excise.niuke._40;


import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author wlw
 * @date 2023/3/8 11:11 PM
 */
public class _31单词倒排 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String s = str.replaceAll("[^a-zA-Z]", " ");
        String[] s1 = s.split(" ");
        for (int i = s1.length - 1; i >= 0; i--) {
            System.out.print(s1[i]+ " ");
        }

    }
}
